import moduleRegist from '@/utils/moduleRegist';
import { module as ReconciliationModule } from './Module/reconciliationModule';
import { module as AutotrophyModule } from './Module/autotrophyModule';
import { module as ClearingModule } from './Module/clearingModule';
import { module as SceneIncomeModule } from './Module/sceneIncomeModule';
import { module as DiscountCouponModule } from './Module/discountCouponModule';
import { module as CompanyModule } from './Module/companyModule';

const Layout = resolve => { require(['./Layout'], resolve); };
const Reconciliation = resolve => { require(['./Reconciliation'], resolve); };
const Autotrophy = resolve => { require(['./Autotrophy'], resolve); };
const Clearing = resolve => { require(['./Clearing'], resolve); };
const SceneIncome = resolve => { require(['./SceneIncome'], resolve); };
const DiscountCoupon = resolve => { require(['./DiscountCoupon'], resolve); };
const Company = resolve => { require(['./Company'], resolve); };

/* eslint-disable */
export default [
    /** 配置管理路由 */
    {
        path: 'statementCenter',
        redirect: 'statementCenter/reconciliation',
        component: Layout,
        meta: {
            title: '统计报表',
            name: '统计报表',
            permission: 'trade:settlement:reportStatistics',
            componentName: 'ConfigpayerLayout',
            keepAlive: true,
            icon: '',
            show: false
        },
        beforeEnter: (to, from, next) => {
            moduleRegist(ReconciliationModule);
            moduleRegist(AutotrophyModule);
            moduleRegist(ClearingModule);
            moduleRegist(SceneIncomeModule);
            moduleRegist(DiscountCouponModule);
            moduleRegist(CompanyModule);
            next();
        },
        children: [
            {
                path: 'reconciliation',
                component: Reconciliation,
                meta: {
                    title: '对账函下载',
                    name: '对账函下载',
                    breadcrumb: '对账函下载',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'autotrophy',
                component: Autotrophy,
                meta: {
                    title: '自营资金清算报表',
                    name: '自营资金清算报表',
                    breadcrumb: '自营资金清算报表',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'clearing',
                component: Clearing,
                meta: {
                    title: '清分情况表',
                    name: '清分情况表',
                    breadcrumb: '清分情况表',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'sceneIncome',
                component: SceneIncome,
                meta: {
                    title: '场景收入成本报表',
                    name: '场景收入成本报表',
                    breadcrumb: '场景收入成本报表',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'discountCoupon',
                component: DiscountCoupon,
                meta: {
                    title: '优惠券报表',
                    name: '优惠券报表',
                    breadcrumb: '优惠券报表',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            // {
            //     path: 'company',
            //     component: Company,
            //     meta: {
            //         title: '云南平台公司报表',
            //         name: '云南平台公司报表',
            //         breadcrumb: '云南平台公司报表',
            //         permission: 'trade:settlement:cmb',
            //         keepAlive: true,
            //         componentName: 'ConfigpayerListView',
            //         icon: ''
            //     }
            // }
        ]
    }
];
